package com.ccnf.model.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@TableName("invitation_reward")
public class InvitationReward extends Model<InvitationReward> {
    @ApiModelProperty("赏金ID")
    @TableId("reward_id")
    private Long rewardId;

    @ApiModelProperty("邀请函ID")
    @TableField("invitation_id")
    private Long invitationId;

    @ApiModelProperty("赏金类型（0：人数奖励，1：排名奖励，2：实物奖励）")
    @TableField("reward_type")
    private Integer rewardType;

    @ApiModelProperty("记录类型（0：浏览，1：登记，2：入场）")
    @TableField("record_type")
    private Integer recordType;

    @ApiModelProperty("领取赏金统计数据值")
    @TableField("record_num")
    private Integer recordNum;

    @ApiModelProperty("随机赏金上限值")
    @TableField("up_reward")
    private BigDecimal upReward;

    @ApiModelProperty("随机赏金下限值")
    @TableField("down_reward")
    private BigDecimal downReward;

    @ApiModelProperty("排名赏金值")
    @TableField("rank_reward")
    private BigDecimal rankReward;

    @ApiModelProperty(value = "创建时间", hidden = true)
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Long createTime;

    @ApiModelProperty(value = "是否删除", hidden = true)
    @TableField("is_deleted")
    private Integer isDeleted;
    /**
     * 开始日期
     */
    @ApiModelProperty("开始日期(请按照格式 yyyy-MM-dd 传递)")
    @TableField("start_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
    private Date startTime;

    /**
     * 结束日期
     */
    @ApiModelProperty("结束日期(请按照格式 yyyy-MM-dd 传递)")
    @TableField("end_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
    private Date endTime;

    @Override
    protected Serializable pkVal() {
        return rewardId;
    }
}